package com.heima.search.repository;

import com.heima.search.entity.ApAssociateWords;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

public interface AssociateWordsRepository extends MongoRepository<ApAssociateWords,String> {

    /**
     * 以输入的关键词开头查询
     * @param word
     * @return
     */
    List<ApAssociateWords>findByAssociateWordsStartingWith(String word);

    /**
     * 以输入的关键词开头分页查询
     * @param word
     * @param pageable
     * @return
     */
    List<ApAssociateWords>findByAssociateWordsStartingWith(String word, Pageable pageable);
}
